|
|
|
|
|
|
|
Next, add the wrCreateDB method from Listing A.33. |
|
|
|
|
|
|
|
|
Listing A.33. Coding the WrCreateDB function. |
|
|
|
|
|
|
|
|
Public Function WrCreateDB(cMDB) As String
'
' write the create db line
'
Dim cTemp As String
'
SQLVBMain.lblProgress = "Creating Script Header..."
DoEvents
'
cTemp = EOL
cTemp = cTemp + "// Create new database" + EOL
cTemp = cTemp + "dbMake " + cDBName + ";"
cTemp = cTemp + EOL
'
WrCreateDB = cTemp
'
End Function |
|
|
|
|
|
|
|
|
The next step is to create each table definition. This is actually a two-step process. First, you need to create the table and its fields. Then you need to create the indexes that belong to the table. The code in Listing A.34 creates the table itself and calls the function to create the field definitions. |
|
|
|
|
|
|
|
|
Listing A.34. Coding the WrCreateTable function. |
|
|
|
|
|
|
|
|
Public Function WrCreateTable(tblObject As TableDef) As String
'
' create a write table SQL statement
'
Dim cTemp As String
Dim cTable As String
Dim objField As Field
'
' ignore system tables
cTable = tblObject.Name
If UCase(Left(cTable, 4)) = "MSYS" Then
WrCreateTable = ""
Exit Function |
|
|
|
|
|